package com.peak.distribution.entity.sales;

import javax.persistence.MappedSuperclass;

import com.peak.distribution.enums.Constants;
import com.peak.spring.boot.api.entity.DefaultStategyEntity;

import lombok.Getter;
import lombok.Setter;

@MappedSuperclass
@Getter
@Setter
public class SalesLog extends DefaultStategyEntity {

	private static final long serialVersionUID = Constants.DISTRIBUTION_VERSION;

	/** 销售金额 */
	protected Integer amount;
	
	/** 销售订单数量 */
	protected Integer orderNum;
	
	/** 商品数量 */
	protected Integer goodsNum;
	

	public void addOrderNum(int size) {
		this.orderNum = this.orderNum == null ? size : this.orderNum + size;
	}

	public void addAmount(Integer amount) {
		this.amount = this.amount == null ? amount : this.amount + amount;
	}
	
	public void addGoodsNum(Integer goodsNum) {
		this.goodsNum = this.goodsNum == null ? goodsNum : this.goodsNum + goodsNum;
	}
}
